#ifndef SHIP_H
#define SHIP_H
#include "GameObjects.h"
#include "GameCore\Sprite.h"
#include "GameCore\TouchManager.h"
#include "GameObjects\Bullet.h"
#include "GameCore\Material.h"
class Ship: public GameObject
{
public:
	
protected:
	Bullet* currentBullet;
	float coolDownTime;
	int damage;
	Material* material;
public:
	virtual void Init();
	virtual void Update(float timeDelta);

	virtual ~Ship()
	{
		SafeDelete(currentBullet);
	}
	
	void Fire();
	bool CanFire();
	virtual void Damaged(Bullet* bullet)
	{
		hp -= bullet->damage;
		if(hp <= 0) Destroy();
	}
	virtual void Damaged(Ship* ship)
	{
		hp -= ship->damage;
		if(hp <= 0) Destroy();
	}
	
	static Ship* CreateFromName(const char* name);
};
#endif